package com.gao.window;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;

public class NetBankWindowFactory implements ToolWindowFactory {
    @Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        NetBankWindow netBankWindow = new NetBankWindow(project, toolWindow, UIUtil.isUnderDarcula());
        SqlTransform sqlTransform = new SqlTransform(project, toolWindow);
        ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
        Content mainContent = contentFactory.createContent(netBankWindow.getMainWindow(), "WMS接口", false);
        Content sqlContent = contentFactory.createContent(sqlTransform.getSqlTransform(), "SQL转换", false);
        toolWindow.getContentManager().addContent(mainContent);
        toolWindow.getContentManager().addContent(sqlContent);
    }
}
